package cn.jeefast.modules.platform.service.impl;

import cn.jeefast.common.entity.MbProj;
import cn.jeefast.common.utils.R;
import cn.jeefast.modules.platform.dao.MbProj1Dao;
import cn.jeefast.modules.platform.service.MbProj1Service;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author theodo
 * @since 2020-01-06
 */
@Service
public class MbProj1ServiceImpl extends ServiceImpl<MbProj1Dao, MbProj> implements MbProj1Service {

    @Autowired
    private MbProj1Dao mbProj1Dao;

    /**
     * 添加或编辑项目
     * @param proj
     * @return
     */
    @Override
    public R addOrSave(MbProj proj) {
        if(proj.getId()==null){
            mbProj1Dao.insert(proj);
        }else{
            mbProj1Dao.updateById(proj);
        }
        return R.ok();
    }
}
